Skip to content

Path matching based on regex#387

Closed
jandouwebeekman wants to merge 7 commits intoahx:mainfrom
moneybird:main
Closed

Path matching based on regex#387
jandouwebeekman wants to merge 7 commits intoahx:mainfrom
moneybird:main

Conversation

@jandouwebeekman
Copy link
Copy Markdown
Contributor

This makes it possible to match paths based on the regex provided in the pattern of a path parameter.

As described in #386 this might be needed in some weird APIs

@jandouwebeekman jandouwebeekman requested a review from ahx as a code owner August 14, 2025 13:58
path_item = if PathTemplate.template?(path)
@dynamic[path] ||= { template: PathTemplate.new(path) }
@dynamic[path] ||= {
template: PathTemplate.new(path, path_parameters, use_patterns_for_path_matching)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of not calling PathTemplate.new if use_patterns_for_path_matching is true, but a new class MyPatternMatchingTemplate.new?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am totally fine with that but I guess we should first finish the discussion in the issue as these changes are not necessary if you do not agree with the underlying idea of the problem which means the solution will probably stay on a fork forever

@jandouwebeekman
Copy link
Copy Markdown
Contributor Author

in #386 (comment) it was determined that this would not be chosen as a solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants